<template>
	<div id="app">
		<Loading v-show="loading" />
		<router-view />
	</div>
</template>
<script>
import Loading from '@/components/loadingTwo.vue'
export default {
	components: {
		Loading,
	},
	data() {
		return {
			loading: false,
		}
	},
	watch: {
		$route(to, from) {
			this.loading = false
			if (from.path == '/') {
				return
			}
			let time = 500
			this.loading = true
			this.$nextTick(() => {
				setTimeout(() => {
					this.loading = false
				}, time)
			})
		},
	},
	mounted() {
		setTimeout(() => {
			document.getElementById('appLoading').style.display = 'none'
		}, 300)
	},
}
</script>
<style>
#app {
	width: 100%;
	height: 100%;
	position: relative;
}
</style>
